package com.meituan.sqt.response;

import lombok.Data;

/**
 * @author: chenzhenfeng@meituan.com
 * @date: 2020/10/29 8:03 下午
 * @description:
 */
@Data
public class BaseApiResponse<T> {
    private Integer status;
    private String msg;
    private T data;

    public BaseApiResponse() {

    }

    public BaseApiResponse(T data, int status, String msg) {
        this.status = status;
        this.msg = msg;
        this.data = data;
    }

    public static <T> BaseApiResponse<T> success(T data) {
        return new BaseApiResponse(data, 0, "成功");
    }

    public static <T> BaseApiResponse<T> fail(String msg) {
        return new BaseApiResponse(null, 99999, msg);
    }
}
